import { request } from '@/service/request';

/** 获取用户游戏记录列表 */
export function fetchGetUserGameRecordList (params?: Api.Games.UserGameRecordSearchParams) {
    return request<Api.Games.UserGameRecordList>({
        url: '/games/userGameRecord/list',
        method: 'get',
        params
    });
}

/** 新增用户游戏记录 */
export function fetchCreateUserGameRecord (data: Api.Games.UserGameRecordOperateParams) {
    return request<boolean>({
        url: '/games/userGameRecord',
        method: 'post',
        data
    });
}

/** 修改用户游戏记录 */
export function fetchUpdateUserGameRecord (data: Api.Games.UserGameRecordOperateParams) {
    return request<boolean>({
        url: '/games/userGameRecord',
        method: 'put',
        data
    });
}

/** 批量删除用户游戏记录 */
export function fetchBatchDeleteUserGameRecord (recordIds: CommonType.IdType[]) {
    return request<boolean>({
        url: `/games/userGameRecord/${recordIds.join(',')}`,
        method: 'delete'
    });
}
